home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
a_utils
/
perl
/
perl5a1.lha
/
perl5alpha1
/
do
/
semop
< prev
next >
Wrap
Text File
|
1992-08-15
|
558b
|
28 lines
int
do_semop(arglast)
int *arglast;
{
#ifdef HAS_SEM
register STR **st = stack->ary_array;
register int sp = arglast[0];
STR *opstr;
char *opbuf;
int id, opsize;
id = (int)str_gnum(st[++sp]);
opstr = st[++sp];
opbuf = str_get(opstr);
opsize = opstr->str_cur;
if (opsize < sizeof(struct sembuf)
|| (opsize % sizeof(struct sembuf)) != 0) {
errno = EINVAL;
return -1;
}
errno = 0;
return semop(id, (struct sembuf *)opbuf, opsize/sizeof(struct sembuf));
#else
fatal("semop not implemented");
#endif
}